package week1;

import java.util.Arrays;

public class Test {
	public static void main(String[] args) {
		Graph g1 = new UndiredGraph(7);
		// Graph g2 = new DiredGraph(4);
		// g2.addE(0, 3);
		// g2.addE(0, 3);
		// g2.addE(0, 1);
		// g2.addE(1, 3);
		// g2.addE(1, 2);
		// g2.addE(3, 2);
		// System.out.println("so canh la "+ g2.numofDeg());
		// System.out.println("so bac cua dinh 1 la "+ g2.deg(0));

		g1.addE(0, 1);
		g1.addE(0, 2);
		g1.addE(0, 6);
		g1.addE(1, 3);
		g1.addE(1, 2);
		g1.addE(1, 5);
		g1.addE(2, 6);
		g1.addE(2, 3);
		g1.addE(3, 5);
		g1.addE(3, 6);
//		g1.addE(6, 4);
		System.out.println("so canh la " + g1.numofDeg());
		System.out.println("so bac cua dinh la " + g1.deg(2));

		for (int i = 0; i < g1.matrix.length; i++) {
			System.out.println(Arrays.toString(g1.matrix[i]));
		}
		System.out.println(g1.lienThong(2));
	}
}
